<?php
/**
 * Created by PhpStorm.
 * User: 彭奇
 * Date: 2018/9/28
 * Time: 9:23
 */
include "mySql.php";
$db=new mySql();
//作业2//$add=$db->insert("INSERT INTO t_student VALUES(2009010001,\"张学友\",\"男\",\"1980-10-4\",\"2009-9-1\",150123456789,\"湖南长沙\",\"无\");");


//查询湖南长沙
//
//$sel=$db->select("SELECT* FROM t_student WHERE Birth_place=\"湖南长沙\"");
//张学友所有成绩
/*$sel=$db->select("SELECT a.`stu_id`,a.`name`,b.`score_id`,c.`course_name`,b.`score`
                              FROM T_student a 
                              INNER JOIN T_score b 
                              ON a.`stu_id` =b.`stu_id` 
                              LEFT JOIN T_course c
                              ON b.`course_number`=c.`course_id`
                              WHERE a.`name` = '张学友';\"");*/


//数据库平均成绩
$sel=$db->select("SELECT AVG(t_score.`Score`) FROM t_score WHERE Course_id=1;");
